home *** CD-ROM | disk | FTP | other *** search
/ PC Open 107 / PC Open 107 CD 1.bin / CD1 / INTERNET / COPIA SITI / Getleft / getleft-setup-notcl.exe / {app} / scripts / Ventana.tcl < prev   
Encoding:
Text File  |  2004-03-11  |  22.2 KB  |  676 lines

  1. ###############################################################################
  2. ###############################################################################
  3. #####                            Ventana.tcl
  4. ###############################################################################
  5. ##### Creates the window which will provide some information to the user 
  6. ##### while a file is being downloaded.
  7. ###############################################################################
  8. ##### Copyright 1999-2004 AndrΘs Garcφa Garcφa - fandom@retemail.es
  9. ##### Distributed under the terms of the GPL v2
  10. ###############################################################################
  11.  
  12. namespace eval Ventana {
  13.  
  14. source [file join $dirGetleft(scripts) Rizo.tcl]
  15.  
  16. ###############################################################################
  17. # DefineButtonImages
  18. #    Reads the images needed to create the 'downloading' window.
  19. ###############################################################################
  20. proc DefineButtonImages {} {
  21.     global   dirGetleft
  22.     variable images
  23.  
  24.     set images(url)    [image create photo                             \
  25.             -file [file join "$dirGetleft(icons)" html.gif]]
  26.     set images(folder) [image create photo                             \
  27.             -file [file join "$dirGetleft(icons)" folder.gif]]
  28.     set images(files)  [image create photo                             \
  29.             -file [file join "$dirGetleft(icons)" files.gif]]
  30.     set images(clock)  [image create photo                             \
  31.             -file [file join "$dirGetleft(icons)" clock.gif]]
  32.  
  33.     set images(pause)  [image create photo                             \
  34.             -file  [file join "$dirGetleft(icons)" pauses.gif]]
  35.     set images(resume) [image create photo                             \
  36.             -file  [file join "$dirGetleft(icons)" resumes.gif]]
  37.     set images(stop)   [image create photo                             \
  38.             -file  [file join "$dirGetleft(icons)" stops.gif]]
  39.     set images(conf)   [image create photo                             \
  40.             -file  [file join "$dirGetleft(icons)" confs.gif]]
  41.  
  42.     return
  43. }
  44.  
  45. ###############################################################################
  46. # ShowResumeButton
  47. #    When the user pauses the download, the 'Pause' menu button is 
  48. #    subtituted by the 'Resume' button
  49. ###############################################################################
  50. proc ShowResumeButton {} {
  51.     variable window
  52.     variable menus
  53.     global   getleftState
  54.  
  55.     if {$getleftState(os)=="win"} {
  56.         set offset -2
  57.     } else {
  58.         set offset -3
  59.     }
  60.  
  61.     $window(pause) configure -state disabled
  62.     place $window(resume) -in $window(pause) -x $offset -y $offset
  63.  
  64.     $menus(stop) entryconfigure 3 -state disabled
  65.  
  66.     return
  67. }
  68.  
  69. ###############################################################################
  70. # HideResumeButton
  71. #    And when the download is resumed it is hidden again.
  72. ###############################################################################
  73. proc HideResumeButton {} {
  74.     variable window
  75.     variable menus
  76.  
  77.     place forget $window(resume)
  78.     $window(pause) configure -state normal
  79.  
  80.     $menus(stop) entryconfigure 3 -state normal
  81.  
  82.     return
  83. }
  84.  
  85. ###############################################################################
  86. # PauseDownloading
  87. #    Pauses the downloading according to the menu entries.
  88. #
  89. # Parameter
  90. #    which: either 'file' or 'page'
  91. ###############################################################################
  92. proc Pause {which} {
  93.     global getleftOptions labelTitles labelMessages
  94.     variable window
  95.  
  96.     set windowState [wm state $window(top)]
  97.     if {$windowState=="iconic"} {
  98.         wm deiconify $window(top)
  99.     }
  100.  
  101.     ShowResumeButton
  102. #    tk_messageBox -title $labelTitles(paused) -icon info -type ok \
  103.          -message $labelMessages(paused) -parent $window(top)
  104.     if {$which=="file"} {
  105.         tkwait variable getleftOptions(pauseFile)
  106.     } else {
  107.         tkwait variable getleftOptions(pausePage)
  108.     }
  109.  
  110.     return
  111. }
  112.  
  113. ###############################################################################
  114. # CancelDownloading
  115. #    This procedure is invoked from the downloading window when you click on
  116. #    the 'cancel' button or you want to close the window
  117. #
  118. # Parameter:
  119. #    parent: The window over which the asking dialog will appear.
  120. #    skip: if skip is 'skip' the current file will be skipped and the next one
  121. #    will begin to be downloaded. If there is no parameter, the downloading
  122. #    will be stopped.
  123. #
  124. # Returns
  125. #    '0' if we are not going to stop.
  126. #    '1' if we are.
  127. ###############################################################################
  128. proc CancelDownloading {parent {skip {} }} {
  129.     global labelTitles labelMessages
  130.     global getleftState getleftOptions
  131.     global ::Ventana::Rizo::curlReport
  132.     variable afterId
  133.     variable waitingPid
  134.     variable window   
  135.  
  136.     if {$getleftState(delayedDown)==0} {
  137.         set what [tk_messageBox -type yesno -icon question -parent $parent \
  138.                 -title $labelTitles(confirm)                               \
  139.                 -message $labelMessages(stopDownload)]
  140.         if {$what=="no"} {
  141.             return 0
  142.         }
  143.         if {[info exists window(bar)]} {
  144.             Progreso::ProgressBarReset $window(bar)
  145.         }
  146.         set Ventana::Rizo::curlReport(left) ""
  147.     }
  148.     catch {after cancel $afterId}
  149.     catch {after cancel $waitingPid}
  150.     catch {Rizo::Lector stopNow}
  151.  
  152.     set getleftOptions(cancelDown)     1
  153.     set Ventana::Rizo::curlReport(end) 1
  154.  
  155.     if {$getleftState(autoDown)==1} {
  156.         mainWin::SetAutoDownload
  157.     }
  158.     if {($skip=="")||($getleftState(filesChosen)==0)} {
  159.         set getleftOptions(stopFile)  1
  160.         set getleftState(downloading) 0
  161.         catch {wm withdraw $window(top)}
  162.     }
  163.  
  164.     incr curlReport(nextFile)
  165.  
  166.     if {$getleftState(waiting)==1} {
  167.         set getleftState(waiting) 0
  168.     }
  169.     return 1
  170. }
  171.  
  172. ###############################################################################
  173. # TrimString
  174. #    Trims the given string so that if it is longer than the available space
  175. #    the middle of it gets substituted with '...', and puts the resulting
  176. #    string in the given label.
  177. #
  178. # Parßmetros
  179. #    cadena: string to trim.
  180. #    labelPath: the label in which the string is going to be shown
  181. ###############################################################################
  182. proc TrimString {cadena labelPath} {
  183.  
  184.     set font     [$labelPath cget -font]
  185.     set color    [$labelPath cget -bg]
  186.     set tmpColor [$labelPath cget -fg]
  187.     set varName  [$labelPath cget -textvariable]
  188.  
  189.     upvar #0 $varName textVariable
  190.     $labelPath configure -fg $color
  191.  
  192.     set textVariable $cadena
  193.     set labelLength  [expr {[winfo width $labelPath]-5}]
  194.     set strLength    [font measure $font -displayof $labelPath $cadena]
  195.  
  196.     if {$labelLength<=$strLength} {
  197.         set strChars [string length $cadena]
  198.         set middle   [expr {round($strChars/2)-2}]
  199.         set primer   [string range $cadena 0 $middle]
  200.         set segun    [string range $cadena [expr {$middle+1}] end]
  201.         set textVariable ""
  202.         append textVariable $primer "..." $segun
  203.         while {[font measure $font -displayof $labelPath $textVariable]>$labelLength} {
  204.             regsub {(.)(\.\.\.)(.)} $textVariable {...} textVariable
  205.         }
  206.         BalloonHelp::set_balloon $labelPath $cadena
  207.     } else {
  208.         BalloonHelp::delete_balloon $labelPath
  209.     }
  210.  
  211.     $labelPath configure -fg $tmpColor
  212.  
  213.     return
  214. }
  215.  
  216. ###############################################################################
  217. # FileStrings
  218. #    Controls the strings that will be put in the downloading window, to
  219. #    show the name and directory of the file being processed or downloaded
  220. #
  221. # Parameter:
  222. #    url to be downloaded or preprocessed
  223. ###############################################################################
  224. proc FileStrings {url} {
  225.     global directories labelMessages
  226.     variable window
  227.  
  228.     set fileName  [::Commands::UrlToFile $url $directories(base)]
  229.     set parsedUrl [HtmlParser::ParseUrl $url]
  230.     set domain    [string tolower [lindex $parsedUrl 1]]
  231.     set domainTmp [string map {: ""} $domain]
  232.     if {[regexp -nocase "(?:$directories(base)/$domainTmp/)(.*)" \
  233.             $fileName nada tmp]==0} {
  234.         set tmp ""
  235.     }
  236.  
  237.     if {![regexp {(.*)(?:/)(.*)} $tmp nada tmpDir tmpFile]} {
  238.         set tmpDir ""
  239.         set tmpFile $tmp
  240.     }
  241.  
  242.     TrimString $domain  $window(url)
  243.     TrimString $tmpDir  $window(dir)
  244.     TrimString $tmpFile $window(file)
  245.  
  246.     update
  247.  
  248.     return
  249. }
  250.  
  251. ###############################################################################
  252. # DownloadWindow
  253. #    Creates the window, in which some info about the downloading will be
  254. #    displayed.
  255. ###############################################################################
  256. proc DownloadWindow {} {
  257.     global labelButtons labelDialogs labelMenus dirGetleft
  258.     variable window
  259.     variable menus
  260.     variable images
  261.  
  262.     DefineButtonImages
  263.  
  264.     set win [toplevel .bajando]
  265.     wm geometry  $win 290x160
  266.     wm resizable $win 0 0
  267.  
  268.     set marco     [frame $win.marco]
  269.     set marco_in  [frame $marco.marco_interno]
  270.     set marco_url [frame $marco_in.url]
  271.     set marco_dir [frame $marco_in.dir]
  272.     set marco_fil [frame $marco_in.fil]
  273.     set marco_que [frame $marco_in.que]
  274.     set marco_bar [frame $marco_in.bar]
  275.     set botones   [frame $win.botones]
  276.  
  277.     set etq_url   [label $marco_url.etq_url  -image $images(url)]
  278.     set etq_dir   [label $marco_dir.etq_dir  -image $images(folder)]
  279.     set etq_file  [label $marco_fil.etq_file -image $images(files)]
  280.     set etq_que   [label $marco_que.etq_que  -image $images(clock)]
  281.  
  282.     BalloonHelp::set_balloon $etq_url  $labelDialogs(url)
  283.     BalloonHelp::set_balloon $etq_dir  $labelDialogs(dir)
  284.     BalloonHelp::set_balloon $etq_file $labelDialogs(file)
  285.     BalloonHelp::set_balloon $etq_que  $labelDialogs(left)
  286.  
  287.     set etq_url2  [label $marco_url.etq_url2  -width 45 -anchor w         \
  288.             -bd 2 -relief sunken -textvariable Ventana::window(labelUrl)]
  289.     set etq_dir2  [label $marco_dir.etq_dir2  -width 45 -anchor w         \
  290.             -textvariable Ventana::window(labelDir)]
  291.     set etq_file2 [label $marco_fil.etq_file2 -width 45 -anchor w         \
  292.             -textvariable Ventana::window(labelFile)]
  293.     set etq_que2  [label $marco_que.etq_que2  -width 30 -anchor w         \
  294.             -textvariable Ventana::Rizo::curlReport(left)]
  295.  
  296.     set progressBar [Progreso::ProgressBar $marco_bar.progress]
  297.  
  298.     set window(top)  $win
  299.     set window(url)  $etq_url2
  300.     set window(dir)  $etq_dir2
  301.     set window(file) $etq_file2
  302.     set window(left) $etq_que2
  303.     set window(bar)  $progressBar
  304.  
  305.     set config   [button $botones.config -width 48 -height 20 -image $images(conf)      \
  306.             -command "mainWin::UrlListChangeOptions $window(top)"]
  307.     set pause    [menubutton $botones.pause -menu $botones.pause.menu                   \
  308.             -width 50 -height 22 -image $images(pause) -relief raised]
  309.     set stop     [menubutton $botones.stop  -menu $botones.stop.menu                    \
  310.             -width 50 -height 22 -image $images(stop)  -relief raised]
  311.     set resume   [button $botones.resume -width 48 -height 20 -image $images(resume)    \
  312.             -command "::Ventana::ResumeDownloading"]
  313.  
  314.     ::BalloonHelp::set_balloon $config $labelDialogs(options)
  315.     ::BalloonHelp::set_balloon $pause  $labelDialogs(pause)
  316.     ::BalloonHelp::set_balloon $stop   $labelDialogs(stop)
  317.     ::BalloonHelp::set_balloon $resume $labelDialogs(start)
  318.  
  319.     set menus(pause) [menu $pause.menu -tearoff 0 -fg black -postcommand "
  320.             BalloonHelp::kill_balloon
  321.     "]
  322.     $menus(pause) add command -label $labelMenus(stopNow) -command {
  323.             Ventana::PauseDownloading now
  324.     }
  325.     $menus(pause) add check -variable getleftOptions(pausePage)              \
  326.             -onvalue 1 -offvalue 0 -label $labelMenus(stopPage)
  327.     $menus(pause) add check -variable getleftOptions(pauseFile)              \
  328.             -onvalue 1 -offvalue 0 -label $labelMenus(stopFile)
  329.  
  330.     set menus(stop) [menu $stop.menu -tearoff 0 -fg black -postcommand "
  331.             BalloonHelp::kill_balloon
  332.     "]
  333.     $menus(stop) add command -label $labelMenus(stopNow) -command {
  334.         if {$getleftState(delayedDown)==1} Delay::DelayedCancelDelay
  335.         ::Ventana::CancelDownloading $Ventana::window(top)
  336.     }
  337.     $menus(stop) add check -variable getleftOptions(stopPage)                \
  338.             -onvalue 1 -offvalue 0 -label $labelMenus(stopPage)              \
  339.             -command {
  340.                 if {$getleftState(autoDown)==1}    mainWin::SetAutoDownload
  341.                 if {$getleftState(delayedDown)==1} Delay::DelayedCancelDelay
  342.             }
  343.     $menus(stop) add check -variable getleftOptions(stopFile)                \
  344.             -onvalue 1 -offvalue 0 -label $labelMenus(stopFile)              \
  345.             -command {
  346.                 if {$getleftState(autoDown)==1}    mainWin::SetAutoDownload
  347.                 if {$getleftState(delayedDown)==1} Delay::DelayedCancelDelay
  348.             }
  349.     $menus(stop) add command -label $labelButtons(skip)                      \
  350.             -command "::Ventana::CancelDownloading $Ventana::window(top) skip"
  351.  
  352.     set window(cancel) $stop
  353.     set window(pause)  $pause
  354.     set window(resume) $resume
  355.  
  356.     pack $marco     -ipady 5
  357.     pack $botones   -fill both -expand true -side bottom -padx 7
  358.     pack $marco_in  -padx 10 -side bottom
  359.     pack $marco_url $marco_in $marco_dir $marco_fil $marco_que $marco_bar \
  360.             -fill x
  361.     pack $etq_url   $etq_url2  -side left -pady 2 -padx 2
  362.     pack $etq_dir   $etq_dir2  -side left -pady 2 -padx 2
  363.     pack $etq_file  $etq_file2 -side left -pady 2 -padx 2
  364.     pack $etq_que   $etq_que2  -side left -pady 2 -padx 2
  365.     pack $progressBar
  366.     pack $stop $pause $config -side right -padx 3 -pady 5
  367.  
  368.     wm protocol $win WM_DELETE_WINDOW "::Ventana::CancelDownloading $win"
  369.  
  370.     return
  371. }
  372.  
  373. ###############################################################################
  374. # ShowWindow
  375. #   If needed, maps the downloading window, and sets its title bar
  376. #
  377. # Parameter
  378. #   which: either 'head', 'down', 'process' or 'wait' depending on the action 
  379. #          taking place.
  380. ###############################################################################
  381. proc ShowWindow {which} {
  382.     global   labelTitles labelButtons getleftState
  383.     variable window
  384.     variable action
  385.  
  386.     if {$::getleftState(downloading)==0} {
  387.         if {$::DEBUG==1} {
  388.             tk_messageBox -title Error -icon error -type ok         \
  389.                     -message "Pringamos en ShowWindow: $which"
  390.         }
  391.         return
  392.     }   
  393.  
  394.     if {![winfo exists .bajando]} {
  395.         DownloadWindow
  396.     } else {
  397.         set state [wm state $window(top)]
  398.         if {$state=="withdrawn"} {
  399.             wm deiconify $window(top)
  400.         }
  401.     }
  402.  
  403.     switch -exact $which {
  404.         head {
  405.             wm title $window(top) $labelTitles(connect)
  406.         }
  407.         down {
  408.             wm title $window(top) $labelTitles(download)
  409.         }
  410.         process {
  411.             wm title $window(top) $labelTitles(process)
  412.             set action process
  413.         }
  414.         wait {
  415.             StartWaiting 10
  416.         }
  417.     }
  418.  
  419.     update
  420.  
  421.     return
  422. }
  423.  
  424. ###############################################################################
  425. # FileDownloading
  426. #   Creates a nice window to show info about how the downloading goes
  427. #
  428. # Parameters:
  429. #    fichero: file in which the link will be saved.
  430. #    enlace:  file url.
  431. #    madre:   referer page for the link
  432. ###############################################################################
  433. proc FileDownloading {fichero enlace madre} {
  434.     global   getleftState directories
  435.     global   labelTitles
  436.     global   Ventana::Rizo::meta
  437.     global   Ventana::Rizo::curlReport
  438.     variable window
  439.     variable file
  440.     variable link
  441.     variable mother
  442.     variable action
  443.  
  444.     if {$getleftState(downloading)==0} {
  445.         return
  446.     }
  447.  
  448.     set file   $fichero
  449. #    set link   $enlace
  450. #    set mother $madre
  451.     set action body
  452.  
  453.     ShowWindow down
  454.     FileStrings $enlace
  455.  
  456.     set curlReport(end)   0
  457.     set curlReport(long)  1
  458.     set curlReport(pause) 0
  459.  
  460.     if {([file exists $fichero])&&($meta(versionServer)>=1.1)} {
  461.         set size [file size $fichero]
  462.         if {($size>$meta(totalBytes))&&($meta(totalBytes)!=0)} {
  463.             file delete $fichero
  464.         } elseif {($size==$meta(totalBytes))&&($meta(totalBytes)!=0)} {
  465.             after 1000 "set ::Ventana::Rizo::curlReport(nextFile) 1"
  466.             return
  467.         }
  468.         Ventana::Rizo::DataRequest $fichero $enlace $madre 1
  469.     } else {
  470.         Ventana::Rizo::DataRequest $fichero $enlace $madre
  471.     }
  472.     BarUpdate
  473.  
  474.     return
  475. }
  476.  
  477. ###############################################################################
  478. # HeadDownloading
  479. #    Gets the headers of the url from the server.
  480. #
  481. # Parameters:
  482. #    enlace: url to download
  483. #    madre:  referer page of the link
  484. ###############################################################################
  485. proc HeadDownloading {enlace madre} {
  486.     global siteUrl getleftState
  487.     variable link
  488.     variable mother
  489.     variable action
  490.  
  491.     set link   $enlace
  492.     set mother $madre
  493.     set action head
  494.  
  495.     ShowWindow head
  496.     FileStrings $enlace
  497.  
  498.     HideResumeButton
  499.  
  500.     if {[regexp {^ftp://} $enlace]} {
  501.         set ::Ventana::Rizo::meta(content)       "nada"
  502.         set ::Ventana::Rizo::meta(totalBytes)    0
  503.         set ::Ventana::Rizo::meta(versionServer) 1.1
  504.         set ::Ventana::Rizo::meta(relocate)      ""
  505.         set ::Ventana::Rizo::curlError           0
  506.         set ::Ventana::Rizo::errorMessage        ""
  507.         return
  508.     }
  509.  
  510.     set Ventana::Rizo::curlReport(end) 0
  511.     Ventana::Rizo::HeadRequest $enlace $madre
  512.     tkwait variable Ventana::Rizo::curlReport(end)
  513.            
  514.     return
  515. }
  516.  
  517. ###############################################################################
  518. # PauseDownloading
  519. #    Takes control when you click on the 'Pause' button.
  520. #
  521. # Parameter:
  522. #    when: 'now' when we click on the 'Now' menu entry, usuful to pause
  523. #    the downloading while a file is being process for links.
  524. ###############################################################################
  525. proc PauseDownloading {{when ""}} {
  526.     global labelButtons getleftOptions
  527.     variable window
  528.  
  529.     if {$when=="now"} {
  530.         set getleftOptions(pauseNow) 1
  531.         set Ventana::Rizo::curlReport(pause) 1
  532.     }
  533.     set Ventana::Rizo::curlReport(pause) 1
  534.     catch {Rizo::Lector stopNow}
  535.     ShowResumeButton
  536.  
  537.     return
  538. }
  539.  
  540. ###############################################################################
  541. # ResumeDownloading
  542. #    Takes control when you click on the 'Resume' button
  543. ###############################################################################
  544. proc ResumeDownloading {} {
  545.     global labelButtons getleftOptions
  546.     variable window
  547.     variable file
  548.     variable link
  549.     variable mother
  550.     variable action
  551.  
  552.     HideResumeButton
  553.  
  554.     if {($getleftOptions(pauseFile)==1)||($getleftOptions(pausePage)==1)} {
  555.         set getleftOptions(pauseFile) 0
  556.         set getleftOptions(pausePage) 0
  557.         return
  558.     }
  559.     set getleftOptions(pauseNow)  0
  560.     set Ventana::Rizo::curlReport(pause) 0
  561.  
  562.     if {$action=="body"} {
  563.         Progreso::ProgressBarReset $window(bar)
  564.         Ventana::Rizo::DataRequest "$file" "$link" "$mother" 1
  565.         Ventana::BarUpdate
  566.     } else {
  567.         HeadDownloading "$link" "$mother"
  568.     }
  569.     return
  570. }
  571.  
  572. ###############################################################################
  573. # StartWaiting
  574. #    This procedure is invoked when a timeout has ocurred, to wait before
  575. #    trying again.
  576. #
  577. # Parameter
  578. #    seconds: The seconds yet to wait
  579. ###############################################################################
  580. proc StartWaiting {seconds} {
  581.     global   getleftState labelTitles
  582.     variable window
  583.     variable waitingPid
  584.  
  585.     if {$seconds==0} {
  586.         InterruptWaiting
  587.         return
  588.     }
  589.  
  590.     wm title $window(top) "$labelTitles(waiting) $seconds"
  591.  
  592.     ShowResumeButton
  593.     $window(resume) configure -command ::Ventana::InterruptWaiting
  594.  
  595.     set waitingPid [after 1000 ::Ventana::StartWaiting [expr $seconds -1]]
  596.  
  597.     return
  598. }
  599.  
  600. ###############################################################################
  601. # InterruptWaiting
  602. #    While waiting to retry after a timeout, if you click on resume
  603. #    this procedure will be invoked.
  604. ###############################################################################
  605. proc InterruptWaiting {} {
  606.     global   getleftState
  607.     variable window
  608.     variable waitingPid
  609.  
  610.     after cancel $waitingPid
  611.  
  612.     HideResumeButton
  613.     $window(resume) configure -command ::Ventana::ResumeDownloading
  614.  
  615.     set getleftState(waiting) 0
  616.  
  617.     return
  618. }
  619.  
  620. ###############################################################################
  621. # BarUpdate
  622. #    Updates the progress bar.
  623. ###############################################################################
  624. proc BarUpdate {} {
  625.     global Ventana::Rizo::curlReport
  626.     global Ventana::Rizo::curlError
  627.     global Ventana::Rizo::meta
  628.     global labelDialogs downOptions getleftOptions
  629.     variable file
  630.     variable link
  631.     variable mother
  632.     variable window
  633.     variable afterId
  634.  
  635.     if {[string match $curlReport(percentage) ""]} return
  636.     Progreso::ProgressBarUpdate $window(bar) $curlReport(percentage)
  637.  
  638.     if {$getleftOptions(pauseNow)==1} {
  639.         return
  640.     }
  641.  
  642.     if {($curlReport(end)==0) && ($curlReport(stop)!=1) \
  643.             && ($curlReport(pause)==0)} {
  644.         set afterId [after 1000 Ventana::BarUpdate]
  645.     } else {
  646.         set curlReport(left) ""
  647.         if {($::DEBUG==1)&&($curlError!=0)} {
  648.             puts "Error $curlError en $file"
  649.         }
  650.         if {($curlError==18)||($curlError==28)} {
  651.             getLog::FileLogEnter $labelDialogs(fileIncom) \
  652.                     "$link" "$mother"                        
  653.             if {($downOptions(resume)==1)&&($curlReport(stop)!=1)} {
  654.                 Progreso::ProgressBarReset $window(bar)
  655.                 if {$curlError==18} {
  656.                     FileDownloading "$file" "$link" "$mother"
  657.                 } else {
  658.                     incr curlReport(nextFile)
  659.                 }
  660.                 return
  661.             }
  662.         }
  663.         if {$curlError==0} {
  664.             Progreso::ProgressBarFull $window(bar)
  665.             update
  666.         }
  667.         after 75
  668.         Progreso::ProgressBarReset $window(bar)
  669.         $window(dir)  configure -text ""
  670.         $window(file) configure -text ""
  671.         incr curlReport(nextFile)
  672.     }
  673.     return
  674. }
  675. }
  676.